/**
 * 
 */

function bold(){
	var tresc=document.getElementById('trescnewsa').value;
	document.getElementById('trescnewsa').value=tresc+"<b></b>";
}
function italic(){
	var tresc=document.getElementById('trescnewsa').value;
	document.getElementById('trescnewsa').value=tresc+"<i></i>";
}
function underline(){
	var tresc=document.getElementById('trescnewsa').value;
	document.getElementById('trescnewsa').value=tresc+"<u></u>";
}
function img(){
	var tresc=document.getElementById('trescnewsa').value;
	document.getElementById('trescnewsa').value=tresc+"<img src=\"http://www.adres.domena/?/zdjecie.rozszerzenie\" width=10% height=10% hspace=15/>";
}
function url(){
	var tresc=document.getElementById('trescnewsa').value;
	document.getElementById('trescnewsa').value=tresc+"<a href=\"http://www.adres.domena\">link</a>";
}
function br(){
	var tresc=document.getElementById('trescnewsa').value;
	document.getElementById('trescnewsa').value=tresc+"<br/>";
}
function preview(){
	var tresc=document.getElementById('trescnewsa').value;
	document.getElementById('podglad').innerHTML="&nbsp;";
	document.getElementById('podglad').innerHTML="<hr><fieldset class=obrys><div class=news><div class=news_tekst>"+tresc+"</div></div></fieldset>";
}
function save(){
	var tresc=document.getElementById('trescnewsa').value;
	var lang=document.getElementById('zapisz').value;
	if(tresc.length>9000) {
		if(lang=="Save") alert("News can not have more than 9000 characters.");
		else  alert("News nie mo\u017ce mie\u0107 ponad 9000 znak\u00f3w.");
		}
	else{	
	var answer;
	if(lang=="Save") answer = confirm ("Are you sure?\nOnly admin can edit or delete news!");
	else  answer = confirm ("Czy jeste\u015b pewien?\nEdytowa\u0107 / Usun\u0105\u0107 news b\u0119dzie m\u00f3g\u0142 tylko admin!");	
	if (answer){
		document.forms['news'].action = "baza?funkcja=news";
		document.forms['news'].submit();
	}
	}
}